<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

    </style>
</head>
<body>

</body>
<script>
    var d=new Date();
    console.log(d)
    console.log(typeof d)           //object 是一个对象

        // 获取系统日期之后，单独获取每个部分
    console.log(d.getFullYear())
    console.log(d.getMonth())       // 0~11
    console.log(d.getDate())

    console.log(d.getDay())         // 0~6

    console.log(d.getHours())
    console.log(d.getMinutes())
    console.log(d.getSeconds())
    console.log(d.getMilliseconds())

        // 获取时间戳：从1970.1.1 0:0:0 到此刻过去了多少毫秒数
    console.log(d.getTime());
    console.log(Date.now());

</script>
</html>
